package com.nagat.http;

import java.io.IOException;
import java.io.OutputStream;

import com.sun.net.httpserver.Headers;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;

public class MyHandler implements HttpHandler{

	@Override
	public void handle(HttpExchange he) throws IOException {
		
		 System.out.println(123);
//         responseHeaders.set("Content-Type", "text/plain");
         he.sendResponseHeaders(200, "haha".length());
         
         OutputStream responseBody =  he.getResponseBody();
         
         responseBody.write("haha".getBytes());
		 System.out.println(456);
		 responseBody.close();
	}

	
}
